using System;
using System.Linq;
using SalesPoint.Model;
using Xtensive.Orm;
using Xtensive.Orm.Security;

namespace SalesPoint.Security
{
  class OrderPermission : Permission<Order>
  {
    public bool CanApprove { get; private set; }

    public OrderPermission(bool canWrite, bool canApprove)
      : base(canWrite)
    {
      CanApprove = canApprove;
    }

    public OrderPermission(bool canWrite, bool canApprove, Func<ImpersonationContext, QueryEndpoint, IQueryable<Order>> query)
      : this(canWrite, canApprove)
    {
      Query = query;
    }
  }
}
